-module(test).
-compile(export_all).

add(A,B) ->
	A+B.
printf(A) ->
	io:format(A++"\n").
len([])->0;
len([_|T])->1+len(T).

fac(N) when N == 0 ->1;
fac(N) when N > 0 -> N*fac(N-1).

tail_fac(N) -> tail_fac(N,1).

tai_fac(0,Acc) -> Acc.
tail_fac(N,Acc) when N > 0 -> tail_fac(N-1,N*Acc).




